﻿<UserControl x:Class="Cryomancer.StarChart.VSPChartDetailCtrl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:System="clr-namespace:System;assembly=mscorlib"
	xmlns:local="clr-namespace:Cryomancer.StarChart">
	<UserControl.Resources>
		<local:VSPChartDetail x:Key="Test" FOV="180" East="Left" North="Down" Resolution="100" MagLimit="12.0" Name="S Sex" />
		<ObjectDataProvider x:Key="OtherVarsEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
			<ObjectDataProvider.MethodParameters>
				<x:Type TypeName="local:MarkOtherVariables" />
			</ObjectDataProvider.MethodParameters>
		</ObjectDataProvider>
		<ObjectDataProvider x:Key="NorthOrientationEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
			<ObjectDataProvider.MethodParameters>
				<x:Type TypeName="local:NorthOrientation" />
			</ObjectDataProvider.MethodParameters>
		</ObjectDataProvider>
		<ObjectDataProvider x:Key="EastOrientationEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
			<ObjectDataProvider.MethodParameters>
				<x:Type TypeName="local:EastOrientation" />
			</ObjectDataProvider.MethodParameters>
		</ObjectDataProvider>
		<ObjectDataProvider x:Key="ChartCodeEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
			<ObjectDataProvider.MethodParameters>
				<x:TypeExtension TypeName="local:ChartCode" />
			</ObjectDataProvider.MethodParameters>
		</ObjectDataProvider>
	</UserControl.Resources>
	<Grid x:Name="gridMain" Margin="10" DataContext="{StaticResource Test}">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="30.96*" />
			<RowDefinition Height="32*" />
			<RowDefinition Height="32*" />
			<RowDefinition Height="32*" />
			<RowDefinition Height="32*" />
			<RowDefinition Height="32*" />
			<RowDefinition Height="38*" />
			<RowDefinition Height="38*" />
			<RowDefinition Height="38*" />
			<RowDefinition Height="33*" />
			<RowDefinition Height="32*" />
			<RowDefinition Height="32*" />
			<RowDefinition Height="32*" />
		</Grid.RowDefinitions>
		
		<Label>Name</Label>
		<TextBox Grid.Column="1" Margin="5" Name="textBoxName" Text="{Binding Path=Name}" />

		<Label Grid.Row="1"   >RA</Label>
		<TextBox Grid.Column="1" Grid.Row="1" Margin="5" Name="textBoxRA"   ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}">
			<TextBox.Text>
				<Binding Path="RA">
					<Binding.ValidationRules>
						<local:RARangeRule />
					</Binding.ValidationRules>
				</Binding>
			</TextBox.Text>
		</TextBox>
		
		<Label Grid.Row="2"  >DEC</Label>
		<TextBox Grid.Column="1" Grid.Row="2" Margin="5" Name="textBoxDec"  ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}">
			<TextBox.Text>
				<Binding Path="Declination">
					<Binding.ValidationRules>
						<local:DecRangeRule />
					</Binding.ValidationRules>
				</Binding>
			</TextBox.Text>
		</TextBox>

		<Label Grid.Row="3"  >Title</Label>
		<TextBox Grid.Column="1" Grid.Row="3" Margin="5"  Name="textBoxTitle" Text="{Binding Path=Title}"  />
	
		<Label Grid.Row="4"  >Comment</Label>
		<TextBox Grid.Column="1" Grid.Row="4" Margin="5" Name="textBoxComment" Text="{Binding Path=Comment}"  />
	
		<Label Grid.Row="5" >Chart Type</Label>
		<ComboBox Grid.Column="1" Grid.Row="5"  Margin="5" Name="comboBoxChartType"  SelectedItem="{Binding Path=LegacyChartCode}" ItemsSource="{Binding Source={StaticResource ChartCodeEnum}}" />

		<Label Grid.Row="6"   >FOV</Label>
		<Slider Grid.Column="1" Grid.Row="6" Margin="5"  Name="sliderFOV" Value="{Binding Path=FOV}"  Minimum="0" Maximum="900" Style="{DynamicResource FOVValueSliderStyle}"/>

		<Label Grid.Row="7"    >Resolution</Label>
		<Slider Grid.Column="1" Grid.Row="7" Margin="5" Name="sliderResolution"  Value="{Binding Path=Resolution}"  Maximum="300" Minimum="75" Style="{DynamicResource IntegerValueSliderStyle}"  />

		<Label Grid.Row="8"   >Magnitude Limit</Label>
		<Slider Grid.Column="1" Grid.Row="8" Margin="5" Name="sliderMagLimit" Value="{Binding Path=MagLimit}"   Minimum="5" Maximum="25" SmallChange="0.1" Style="{DynamicResource DecimalValueSliderStyle}" />

		<Label Grid.Row="9"   >North</Label>
		<ComboBox Grid.Column="1" Grid.Row="9" Margin="5" Height="23" Name="comboBoxNorth" SelectedItem="{Binding Path=North}" ItemsSource="{Binding Source={StaticResource NorthOrientationEnum}}" />

		<Label Grid.Row="10"   >East</Label>
		<ComboBox Grid.Column="1" Grid.Row="10" Margin="5" Name="comboBoxEast" SelectedItem="{Binding Path=East}" ItemsSource="{Binding Source={StaticResource EastOrientationEnum}}" />

		<Label Grid.Row="11" >Other Variables</Label>
		<ComboBox Grid.Column="1" Grid.Row="11"  Margin="5" Name="comboBoxOtherVars"  SelectedItem="{Binding Path=OtherVariables}"  ItemsSource="{Binding Source={StaticResource OtherVarsEnum}}" />
	
		<Label Grid.Row="12" >Chart ID</Label>
		<TextBox Grid.Column="1" Grid.Row="12" Margin="5" Name="textBoxChartID"  Text="{Binding Path=ChartID}"/>

	</Grid>
</UserControl>
